
import requests from './request';
import mockrequest from './mockrequest';

export const regCategoryList = () => {

    return requests({
        url: "/product/getBaseCategoryList",
        method: 'get',
    })
}
export const regcontainList = () => {
    //   请求的模拟数据
    return mockrequest({
        url: "/banner",
        method: 'get',
    })
}
export const regfloorList = () => {
    //   请求的模拟数据
    return mockrequest({
        url: "/floor",
        method: 'get',
    })
}
export const reggetsearchList = (canshu) => {
    return requests({
        url: "/list",
        method: 'post',
        data: canshu,
    })

}
export const regGetDetailList = (skuId) => {
    return requests({
        url: `/item/${skuId}`,
        method: 'get',
    })
}
export const regGetShopCartData = (skuId, skuNum) => {
    return requests({
        url: `/cart/addToCart/${skuId}/${skuNum}`,
        method: 'post',
    })

}
export const regCartList = () => {
    return requests({
        url: `/cart/cartList`,
        method: 'GET',
    })

}
export const regDeleteCartGoods = (skuId) => {
    return requests({
        url: `/cart/deleteCart/${skuId}`,
        method: 'delete',
    })

}
export const reqUpdatacheckedByid = (skuId, isChecked) => {
    return requests({
        url: `cart/checkCart/${skuId}/${isChecked}`,
        method: 'get'
    })
}
//发送用户验证码
export const reqUsercode = (phone) => requests({ url: `/user/passport/sendCode/${phone}`, method: 'get' })

//发送注册请求
export const reqRegister = (element) => requests({ url: `/user/passport/register`, data: element, method: 'post' })
//发送登录请求
export const reqlogin = (element) => requests({ url: `/user/passport/login`, data: element, method: 'post' })
//获得用户的信息
export const reqUserInfo = () => requests({ url: `/user/passport/auth/getUserInfo`, method: 'get' });
//退出登录请求
export const reqOutLogin = () => requests({ url: `/user/passport/logout`, method: 'get' })
//??用户地址请求  这样用老师的账号登录 才有数据
export const reqUseraddress = () => requests({ url: `/user/userAddress/auth/findUserAddressList`, method: 'get' })
// 获得用户商品清单信息
export const reqgoodslist = () => requests({ url: `/order/auth/trade`, method: 'get' })
//提交订单信息  成功后 会返回订单号信息   orderId 订单号  等下会用于获得订单支付信息 和其他的请求中
export const reqBuyGoodsList = (tradeNo, data) => requests({ url: `/order/auth/submitOrder?tradeNo=${tradeNo}`, data, method: 'post' })
//获得订单支付信息 比如金额  订单号 微信支付码
export const reqOrderBuyInfo = (orderId) => requests({ url: `/payment/weixin/createNative/${orderId}`, method: 'get' })
//获得支付的状态
export const reqPayState = (orderId) => requests({ url: `/payment/weixin/queryPayStatus/${orderId}`, method: 'get' })
//获得个人中心的订单列表
export const reqPersonList = (page, limit) => requests({ url: `/order/auth/${page}/${limit}`, method: 'get' })